if __name__ == '__main__':
    winning_red = {3, 11, 14, 16, 22, 30}
winning_blue = 6

while True:
    try:
        user_red = list(map(int, input("请输入6个不重复的红球号码（1-33），用空格分隔：").split()))
        user_blue = int(input("请输入1个蓝球号码（1-16）："))
        if (len(user_red) == 6 and len(set(user_red)) == 6 and
            all(1 <= n <= 33 for n in user_red) and 1 <= user_blue <= 16):
            break
        print("输入无效，请重新输入！")
    except:
        print("输入无效，请输入整数！")

red_match = len(set(user_red) & winning_red)
blue_match = user_blue == winning_blue
prize = {(6, True): 1, (6, False): 2, (5, True): 3, (5, False): 4,
         (4, True): 4, (4, False): 5, (3, True): 5,
         (2, True): 6, (1, True): 6, (0, True): 6}.get((red_match, blue_match), 0)

print(f"恭喜中了{prize}等奖！" if prize else "未中奖。")